import axios from 'axios'

export const getPictures = () => {
	return axios.get('/admin/pictures')
		.then((response) => Promise.resolve(response.data.result))
}

export const addPicture = ({ name, tags, path, fileName, url }) => {
	return axios.post('/admin/picture', { name, tags, path, fileName, url })
		.then((response) => Promise.resolve(response.data.result))
}

export const updataPicture = ({ id, name, tags }) => {
	return axios.put('/admin/picture/' + id, { name, tags })
		.then((response) => Promise.resolve(response.data.result))
}

export const deletePicture = (id) => {
	return axios.delete('/admin/picture/' + id)
		.then((response) => Promise.resolve(response.data.result))
}
